package com.lwp.ctable.model;

import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
public class User {
    /**
    * 用户id
    */
    private Long userId;

    /**
    * 用户账号
    */
    private String userAccount;

    /**
    * 账号密码
    */
    private String userPassword;

    /**
    * 用户名
    */
    private String userName;

    /**
    * 用户邮箱
    */
    private String userEamil;

    /**
    * 用户电话
    */
    private String userTel;

    /**
    * 记录创建时间
    */
    private Date crtDatetime;

    /**
    * 记录更新时间
    */
    private Date uptDatetime;

    /**
    * 版本号
    */
    private Integer version;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserAccount() {
        return userAccount;
    }

    public void setUserAccount(String userAccount) {
        this.userAccount = userAccount == null ? null : userAccount.trim();
    }

    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword == null ? null : userPassword.trim();
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    public String getUserEamil() {
        return userEamil;
    }

    public void setUserEamil(String userEamil) {
        this.userEamil = userEamil == null ? null : userEamil.trim();
    }

    public String getUserTel() {
        return userTel;
    }

    public void setUserTel(String userTel) {
        this.userTel = userTel == null ? null : userTel.trim();
    }

    public Date getCrtDatetime() {
        return crtDatetime;
    }

    public void setCrtDatetime(Date crtDatetime) {
        this.crtDatetime = crtDatetime;
    }

    public Date getUptDatetime() {
        return uptDatetime;
    }

    public void setUptDatetime(Date uptDatetime) {
        this.uptDatetime = uptDatetime;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userId=").append(userId);
        sb.append(", userAccount=").append(userAccount);
        sb.append(", userPassword=").append(userPassword);
        sb.append(", userName=").append(userName);
        sb.append(", userEamil=").append(userEamil);
        sb.append(", userTel=").append(userTel);
        sb.append(", crtDatetime=").append(crtDatetime);
        sb.append(", uptDatetime=").append(uptDatetime);
        sb.append(", version=").append(version);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        User other = (User) that;
        return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getUserAccount() == null ? other.getUserAccount() == null : this.getUserAccount().equals(other.getUserAccount()))
            && (this.getUserPassword() == null ? other.getUserPassword() == null : this.getUserPassword().equals(other.getUserPassword()))
            && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
            && (this.getUserEamil() == null ? other.getUserEamil() == null : this.getUserEamil().equals(other.getUserEamil()))
            && (this.getUserTel() == null ? other.getUserTel() == null : this.getUserTel().equals(other.getUserTel()))
            && (this.getCrtDatetime() == null ? other.getCrtDatetime() == null : this.getCrtDatetime().equals(other.getCrtDatetime()))
            && (this.getUptDatetime() == null ? other.getUptDatetime() == null : this.getUptDatetime().equals(other.getUptDatetime()))
            && (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getUserAccount() == null) ? 0 : getUserAccount().hashCode());
        result = prime * result + ((getUserPassword() == null) ? 0 : getUserPassword().hashCode());
        result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
        result = prime * result + ((getUserEamil() == null) ? 0 : getUserEamil().hashCode());
        result = prime * result + ((getUserTel() == null) ? 0 : getUserTel().hashCode());
        result = prime * result + ((getCrtDatetime() == null) ? 0 : getCrtDatetime().hashCode());
        result = prime * result + ((getUptDatetime() == null) ? 0 : getUptDatetime().hashCode());
        result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode());
        return result;
    }
}